/**
 * Created by Administrator on 2017/2/15.
 */

$(function(){
    $('#submit').click(function(){
        $url=$('#change_url').val();
        $inde_url=$('#index_url').val();
        $nodecode=$('input[name=nodecode]').val();
        $userpwd=$('input[name=userpwd]').val();
        $token=$('input[name=_token]').val();
        if($userpwd==''||$nodecode==''){
            alert('用户名或密码不能为空');
            return;
        }
        $.ajax({
            type: "post",
            url: $url,
            data: {nodecode:$nodecode,userpwd:$userpwd,_token:$token},
            dataType: "json",
            success: function(data){
                if(data.code==200){
                    //alert('登录成功');
                    location.href=$inde_url;
                }else{
                    alert(data.message);
                    return;
                }
            }
        });
    });
})